import request from '@/utils/request'

// 查询BaoStock股票日线列表
export function listBaostockDaily(query) {
  return request({
    url: '/stock/baostock/daily/list',
    method: 'get',
    params: query
  })
}

// 查询BaoStock股票日线详细
export function getBaostockDaily(id) {
  return request({
    url: '/stock/baostock/daily/detail',
    method: 'get',
    params: { id }
  })
}

// 从BaoStock获取股票日线数据
export function fetchBaostockDaily(data) {
  return request({
    url: '/stock/baostock/daily/fetch',
    method: 'post',
    data: data
  })
}

// 同步BaoStock股票日线数据到数据库
export function syncBaostockDaily(data) {
  return request({
    url: '/stock/baostock/daily/sync',
    method: 'post',
    data: data
  })
}

// 批量同步BaoStock股票日线数据
export function batchSyncBaostockDaily(data) {
  return request({
    url: '/stock/baostock/daily/batch-sync',
    method: 'post',
    data: data
  })
}

// 删除BaoStock股票日线
export function delBaostockDaily(id) {
  return request({
    url: '/stock/baostock/daily/delete',
    method: 'delete',
    data: { id }
  })
}

// 获取BaoStock股票代码列表
export function getBaostockSymbols() {
  return request({
    url: '/stock/baostock/daily/symbols',
    method: 'get'
  })
}